package com.lpy.service;

import com.lpy.spring.*;
import lombok.NoArgsConstructor;

/**
 * @Description:
 * @author: LiuPengYu
 * @date 2024/11/16 14:23
 */
@Component
//@Scope
@NoArgsConstructor
public class UserService implements BeanNameAware, InitializingBean {

    private OrderService orderService;

    @Autowired
    public UserService(OrderService orderService) {
        this.orderService = orderService;
    }

    private String beanName;


    public void test(){
        System.out.println("一切准备就绪，打印地址"+orderService);
    }

    @Override
    public void setBeanName(String beanName) {
        this.beanName = beanName;
    }

    @Override
    public void afterPropertiesSet() {
        System.out.println("额外初始化操作");
    }
}
